
// Project
#include <Gui/gamewgt.h>
#include <Gui/RenderingWidget.h>

#include <Util/DataFinder.h>

// Qt
#include <QGridLayout>
#include <QLabel>


namespace Gui{

    GameWgt::GameWgt(QWidget *parent) :
        QWidget(parent)
    {
        int w(600), h(600);
        this->setBaseSize(w,h);
        this->setMinimumSize(w,h);
        this->setMaximumSize(w,h);

        layout = new QGridLayout(this);
        this->setLayout(layout);

        //pauseImg = new QImage(DATA("logo.png"));
        QPixmap pix(DATA("logo.png"));
        pix = pix.scaledToHeight(400);
        pauseLbl = new QLabel(this);
        pauseLbl->setPixmap(pix);
        pauseLbl->setAlignment(Qt::AlignCenter|Qt::AlignHCenter);

        layout->addWidget(pauseLbl);
    }

    void GameWgt::startGame()
    {
        layout->removeWidget(pauseLbl);

        openGLGame = new RenderingWidget(this);
        layout->addWidget(openGLGame);
    }
}
